<!DOCTYPE html>
<!-- OMG - Simple HTML Template v1.0 -->

<!--[if lt IE 7]><html dir="ltr" lang="en-US" class="lt-ie9 lt-ie8 lt-ie7"><![endif]-->
<!--[if IE 7]><html dir="ltr" lang="en-US" class="lt-ie9 lt-ie8"><![endif]-->
<!--[if IE 8]><html dir="ltr" lang="en-US" class="lt-ie9"><![endif]-->
<!--[if IE 9]><html dir="ltr" lang="en-US"  class="lt-ie10"> <![endif]-->
<!--[if gt IE 9]><!-->
<html dir="ltr" lang="en-US" class="gt-ie9 non-ie"> <!--<![endif]-->
    <head>
        <!-- Meta Tags -->
        <meta charset="UTF-8" />
        <meta name="description" content="" />
        <meta name="author" content="Ilham Alpha Dinov" />

        <!-- Mobile -->
        <!--[if IE]><meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1"><![endif]-->
        <meta name="viewport" content="width=device-width; initial-scale=1.0; maximum-scale=1.0; user-scalable=0;" />

        <!-- Page Title -->
        <title><?php echo $web_title;?></title>

        <!-- Shortcut Icon -->
        <link rel="shortcut icon" href="<?php echo base_url()?>assets/images/logo_IPPI_small.png" />
        
        <!-- Load Font -->
        <link rel="stylesheet" type="text/css" href="http://fonts.googleapis.com/css?family=Open+Sans:400i,400,700,700i" />     

        <!-- Bootstrap Core CSS -->
        <link rel="stylesheet" type="text/css" href="<?php echo base_url()?>assets/css/bootstrap.min.css" rel="stylesheet" />
        <link rel="stylesheet" type="text/css" href="<?php echo base_url()?>assets/css/bootstrap-select.css" rel="stylesheet" />
        <link rel="stylesheet" type="text/css" href="<?php echo base_url()?>assets/css/bootstrap-select-ajax.css" rel="stylesheet" />

        <!-- CSS Stylesheets -->
        <link rel="stylesheet" type="text/css" href="<?php echo base_url()?>assets/css/superfish.css" />
        <link rel="stylesheet" type="text/css" href="<?php echo base_url()?>assets/css/flexslider.css" />
        <link rel="stylesheet" type="text/css" href="<?php echo base_url()?>assets/css/global.css" />
        <link rel="stylesheet" type="text/css" href="<?php echo base_url()?>assets/css/responsive.css" />
        <link rel="stylesheet" type="text/css" href="<?php echo base_url()?>assets/css/colorbox.css" />
        <link rel="stylesheet" type="text/css" href="<?php echo site_url()?>assets/jquery-ui/development-bundle/themes/base/jquery.ui.all.css" />
        <link rel="stylesheet" type="text/css" href="<?php echo base_url()?>assets/css/userdefined.css" />
        <link rel="stylesheet" type="text/css" href="assets/extends/videojs/video-js.css" />

        <!-- JS Header -->
        <!--[if lt IE 9]><script src="assets/js/html5shiv.js"></script><![endif]-->
    </head>
    
    <body onload="initialize()" id="skrollr-body" class="full-width onepage" data-spy="scroll" data-target=".navbar-collapse" data-offset="100">
        <!-- .loading -->
        <div id="mask"><div class="loading"></div></div>
        
        <!-- .content-wrapper -->
        <div id="top" class="content-wrapper">
            <!-- #header -->
            <header id="header" class="navbar-wrapper">
                <!-- #navbar-top -->
                <div id="navbar-top" class="navbar-top">
                    <div class="container">
                        <div class="row">
                            <div class="col-lg-6">
                                <div class="inline-block">
                                    <a href="#" class="logo-wrap"><img src="<?php echo base_url()?>assets/images/logo_IPPI_small.png" style="width:80px;" alt="logo.png" /></a>
                                    <div class="tagline">
                                        <h4>I P P I</h4>
                                        <h5 class="text-primary">Ikatan Perempuan Positif Indonesia</h5>
                                    </div>
                                </div>
                            </div>
                            <div class="col-lg-6">
                                <div class="inline-block text-right register-member">
                                    <?php if( ippi_isset($member_logged) ): ?>
                                        <i class="glyphicon icon-user logged"></i> 
                                        Welcome <strong><?php echo $member_logged->name; ?></strong>&nbsp;&nbsp;
                                        <a href="<?php echo base_url('member/logout'); ?>" class="btn btn-primary btn-sm btn-logout">Logout</a>
                                    <?php else : ?>
                                        <a href="" class="btn btn-primary btn-sm" id="btn-register">Register</a>
                                        <a href="" class="btn btn-primary btn-sm" id="btn-login">login</a>
                                    <?php endif ?>
                                </div>
                            </div>
                        </div>
                    </div>
                </div>
                <!-- /#navbar-top -->

                <!-- #navbar-menu -->
                <div id="navbar-menu" class="navbar navbar-default">
                    <div class="container">
                        <div class="navbar-header"></div>
                        <!-- nav -->
                        <nav class="navbar-collapse collapse" role="navigation">
                            <!-- #nav -->
                            <ul class="nav navbar-nav sf-menu">
                                <li class="active"><a href="#top">Home</a></li>
                                <li><a href="#about">About Us</a></li>
                                <li><a href="#donation">Donation</a></li>
                                <li><a href="#elibrary">E-Library</a></li>
                                <li><a href="#gallery">Gallery</a></li>
                                <li><a href="#events">Events</a></li>
                                <li><a href="#news">News</a></li>
                                <li><a href="#fundrising">Fund Rising</a></li>
                                <li><a href="#reporting">Reporting</a></li>
                                <li><a href="#contact">Contact</a></li>
                                <li><a href="#member">Member</a></li>
                            </ul>
                            <!-- /#nav -->
                        </nav>
                        <!-- /nav -->
                    </div>
                </div>
                <!-- /#navbar-menu -->
            </header>
            <!-- /#header -->

            <!-- #main-content -->
            <section id="main-content" class="post">
                <?php $this->load->view($main_view); ?>
            </section>
            <!-- /#main-content -->

            <!-- #footer -->
            <footer id="footer" class="footer">
                <?php if( !empty($list_donatur) ): ?>
                    <!-- #donatur -->
                    <article id="donatur">
                        <div class="container">
                            <div class="row">
                    			<div class="col-sm-6 text-left"><h4 style="margin: 10px 0; text-transform: none;">Supported By</h4></div>
                    			<div class="col-sm-6 text-right">
                    				<div class="control-nav control-slider pull-right">
                    					<a class="btn-prev" data-control=".donatur-slide"></a>
                    					<a class="btn-next" data-control=".donatur-slide"></a>
                    				</div>
                    			</div>
                    		</div>
                            <div class="row text-center">
                                <div class="donatur-container col-md-12">
                					<div class="donatur-slide clearfix">
                						<ul class="slides">
                                            <?php foreach($list_donatur as $row): ?>
                                            <li>
                								<a href="<?php echo $row->link;?>" data-toggle="tooltip" data-placement="bottom" title="<?php echo $row->title;?>" class="border-hover"><img src="<?php echo base_url($row->image);?>" /></a>
                							</li>
                                            <?php endforeach ?>
                                        </ul>
                                    </div>
                                </div>
                            </div>
                        </div>
                    </article>
                    <!-- /#donatur -->
                <?php endif ?>
            
                <!-- .footer-bottom -->
                <div class="footer-bottom container">
                    <div class="row">
                        <div class="col-md-12">
                            <p class="social-wrap text-center">
                                <a href="#" title="RSS" data-toggle="tooltip" data-tip-bgcolor="#585858" class="social-icon rss-icon img-circle tip-center"></a>
                                <a href="#" title="Google plus" data-toggle="tooltip" data-tip-bgcolor="#585858" class="social-icon google-icon img-circle tip-center"></a>
                                <a href="#" title="Facebook" data-toggle="tooltip" data-tip-bgcolor="#585858" class="social-icon facebook-icon img-circle tip-center"></a>
                                <a href="#" title="Pinterest" data-toggle="tooltip" data-tip-bgcolor="#585858" class="social-icon pinterest-icon img-circle tip-center"></a>
                                <a href="#" title="Flickr" data-toggle="tooltip" data-tip-bgcolor="#585858" class="social-icon flickr-icon img-circle tip-center"></a>
                                <a href="#" title="Dribble" data-toggle="tooltip" data-tip-bgcolor="#585858" class="social-icon dribble-icon img-circle tip-center"></a>
                                <a href="#" title="Twitter" data-toggle="tooltip" data-tip-bgcolor="#585858" class="social-icon twitter-icon img-circle tip-center"></a>
                                <a href="#" title="LinkIn" data-toggle="tooltip" data-tip-bgcolor="#585858" class="social-icon in-icon img-circle tip-center"></a>
                                <a href="#" title="Youtube" data-toggle="tooltip" data-tip-bgcolor="#585858" class="social-icon youtube-icon img-circle tip-center"></a>
                                <a href="#" title="Vimeo" data-toggle="tooltip" data-tip-bgcolor="#585858" class="social-icon vimeo-icon img-circle tip-center"></a>
                                <a href="#" title="Mail" data-toggle="tooltip" data-tip-bgcolor="#585858" class="social-icon mail-icon img-circle tip-center"></a>
                            </p>
                            <div class="copyright-wrap">
                                Copyright 2014 | IPPI by <a href="">IPPI Developer</a>
                            </div>
                        </div>
                    </div>
                </div>
                <!-- /.footer-bottom -->
            </footer>
            <!-- /#footer -->
        </div>
        <!-- /.content-wrapper -->

        <!-- #back-to-top -->
        <div id="back-to-top">
            <a href="#header" class="btn-up"></a>
        </div>
        <!-- /#back-to-top -->

        <!-- Theme core JavaScript ================================================== -->
        <script type="text/javascript" src="<?php echo base_url()?>assets/js/jquery-1.9.1.min.js"></script>
        <script type="text/javascript" src="<?php echo base_url()?>assets/js/bootstrap.min.js"></script>
        <script type="text/javascript" src="<?php echo base_url()?>assets/js/bootstrap-select.js"></script>
        <script type="text/javascript" src="<?php echo base_url()?>assets/js/bootstrap-select-ajax.js"></script>
        <script type="text/javascript" src="<?php echo base_url()?>assets/js/jquery.easing.min.js"></script>
        <script type="text/javascript" src="<?php echo base_url()?>assets/js/jquery.fitvids.js"></script>
        <script type="text/javascript" src="<?php echo base_url()?>assets/js/superfish.min.js"></script>
        <script type="text/javascript" src="<?php echo base_url()?>assets/js/jquery.isotope.min.js"></script>
        <script type="text/javascript" src="<?php echo base_url()?>assets/js/jquery.countdown.js"></script>
        <script type="text/javascript" src="<?php echo base_url()?>assets/js/skrollr.min.js"></script>
        <script type="text/javascript" src="<?php echo base_url()?>assets/js/jquery.knob.js"></script>
        <script type="text/javascript" src="<?php echo base_url()?>assets/js/jquery.jplayer.min.js"></script>
        <script type="text/javascript" src="<?php echo base_url()?>assets/js/jquery.smooth-scroll.min.js"></script>
        <script type="text/javascript" src="<?php echo base_url()?>assets/js/jquery.flexslider-min.js"></script>
        <script type="text/javascript" src="<?php echo base_url()?>assets/js/jquery.slicknav.min.js"></script>
        <script type="text/javascript" src="<?php echo base_url()?>assets/js/jquery.queryloader2.custom.js"></script>
        <script type="text/javascript" src="<?php echo base_url()?>assets/js/jquery.colorbox.js"></script>
        <script type="text/javascript" src="<?php echo site_url()?>assets/jquery-ui/development-bundle/ui/jquery.ui.core.js"></script>
        <script type="text/javascript" src="<?php echo site_url()?>assets/jquery-ui/development-bundle/ui/jquery.ui.widget.js"></script>
        <script type="text/javascript" src="<?php echo site_url()?>assets/jquery-ui/development-bundle/ui/jquery.ui.datepicker.js"></script>
        <script type="text/javascript" src="<?php echo site_url()?>assets/jquery-ui/development-bundle/ui/jquery.ui.autocomplete.js"></script>
        <script type="text/javascript" src="<?php echo site_url()?>assets/extends/videojs/video.js"></script>
        <script type="text/javascript" src="<?php echo base_url()?>assets/js/bootstrap-typeahead.js"></script>
        
        <!-- Form Validation -->
        <script type="text/javascript" src="<?php echo site_url()?>assets/js/jquery.validation.js"></script>
        
        <!-- Load Function -->
        <script type="text/javascript" src="<?php echo base_url()?>assets/js/functions.js"></script>
        
        <!-- Google Map -->
        <script type="text/javascript" src="http://maps.google.com/maps/api/js?sensor=true&amp;key=AIzaSyAEwjSb8uAM8EVJBFtsj4sT_536ls9yJnY"></script>
        <script type="text/javascript" src="<?php echo base_url()?>assets/js/jquery.gomap-1.3.2.min.js"></script>
        
        <!-- User Defined -->
        <script type="text/javascript" src="<?php echo site_url()?>assets/js/userdefined.js"></script>
        
        <!-- FOR KASUS E  -->
        <script type="text/javascript">        
            function initialize() {
                // Cases
                // ----------------------------------------------------
                var map     = null;
                
                <?php
                $string_map = "";
                if( empty($list_kasus) ){
                    $string_map.= "var locations = [];";
                }else{
                    $string_map.= "var locations = [";
                        foreach ($list_kasus as $r) {
                            $string_map.="['".str_replace(PHP_EOL, "", $r->city_name)."',".$r->lat.",".$r->long.",4,"."'".$r->city_name.", ".$r->jumlah." kasus','".$r->jumlah."' ],";
                        }
                    $string_map = substr($string_map, 0, -1);
                    $string_map.= "];";
                }
                echo $string_map;
                ?>
                
                var map = new google.maps.Map(document.getElementById('map-canvas'), {
                    zoom: 5,
                    center: new google.maps.LatLng(-3.0, 115.8),
                    mapTypeId: google.maps.MapTypeId.ROADMAP
                });

                var infowindow = new google.maps.InfoWindow();
                var marker, i;

                for (i = 0; i < locations.length; i++) { 
                    var icon_map = null;
                    
                    if(locations[i][5] < 50){
                        icon_map = "<?php echo base_url() . 'assets/images/icons/marker-blue.png'; ?>";
                    }else if(locations[i][5] >= 50 && locations[i][5] < 100){
                        icon_map = "<?php echo base_url() . 'assets/images/icons/marker-green.png'; ?>";
                    }else if(locations[i][5] >= 100 && locations[i][5] < 150){
                        icon_map = "<?php echo base_url() . 'assets/images/icons/marker-yellow.png'; ?>";
                    }else if(locations[i][5] >= 150){
                        icon_map = "<?php echo base_url() . 'assets/images/icons/marker-red.png'; ?>";
                    }
                                        
                    marker = new google.maps.Marker({
                        position: new google.maps.LatLng(locations[i][1], locations[i][2]),
                        map: map,
                        icon: icon_map
                    });
                    
                    google.maps.event.addListener(marker, 'click', (function(marker, i) {
                        return function() {
                            infowindow.setContent(locations[i][4]);
                            infowindow.open(map, marker);
                        }
                    })(marker, i));
                }
                
                // Services
                // ----------------------------------------------------
                var map_svc = null;
                
                <?php
                $string_map_services = "";
                if( empty($list_services) ){
                    $string_map_services.= "var locations_service = [];";
                }else{
                    $string_map_services.= "var locations_service = [";
                        foreach ($list_services as $r) {
                            $string_map_services .= '[ "'.str_replace(PHP_EOL, "", $r->city_name).'", '.$r->lat.', '.$r->long.', 4, "'.$r->name.'", "'.$r->phone.'", "'.$r->address.'", "'.mysql_real_escape_string($r->description).'" ],';
                        }
                    $string_map_services = substr($string_map_services, 0, -1);
                    $string_map_services.= "];";
                }
                echo $string_map_services;
                ?>
                
                var map_svc = new google.maps.Map(document.getElementById('map-services'), {
                    zoom: 5,
                    center: new google.maps.LatLng(-3.0, 115.8),
                    mapTypeId: google.maps.MapTypeId.ROADMAP
                });
                
                var infowindowSvc = new google.maps.InfoWindow();
                var marker_svc, j;
                
                for (j = 0; j < locations_service.length; j++) { 
                    var icon_map_svc = null;
                    icon_map_svc = "<?php echo base_url() . 'assets/images/icons/hospital.png'; ?>";
              
                    marker_svc = new google.maps.Marker({
                        position: new google.maps.LatLng(locations_service[j][1], locations_service[j][2]),
                        map: map_svc,
                        icon: icon_map_svc
                    });
                                        
                    google.maps.event.addListener(marker_svc, 'click', (function(marker_svc, j) {
                        return function() {
                            infowindowSvc.setContent('<div id="content" style="min-width: 200px; min-height: 250px;">'+
                                '<div id="siteNotice">'+
                                '</div>'+
                                '<h5 id="firstHeading" class="firstHeading" style="margin-top: 0; margin-bottom: 5px;">'+ locations_service[j][4] +'</h5>'+
                                '<div id="bodyContent">'+
                                'Telp : '+ locations_service[j][5] + '<br />' +
                                'Alamat : '+ locations_service[j][6] + '<br /><br />' +
                                locations_service[j][7] +
                                '</div>'+
                                '</div>');
                            infowindowSvc.open(map_svc, marker_svc);
                        }
                    })(marker_svc, j));
                    
                    google.maps.event.addListenerOnce(map_svc, 'idle', function(){
                        google.maps.event.trigger(map_svc, 'resize');
                    });
                }
            }
            
            $(document).ready(function() {
                // Set timeout from option
                var timeout = <?php echo get_option('logtime'); ?> * 1000;
                // Set autologout url
                var url     = 'member/autologout';

                // Function auto logout
                function auto_logout(){
                    // Execute function
                    $.ajax({
            			type : "POST",
            			url  : url,
            			data : {},
            			success: function(response) {
                            if(response != 'Logged') { 
                                $('html, body').animate({ scrollTop: $("#top").offset().top}, 500);
                                $(location).attr('href',response);
                            }
            			}
            		});
                }   
                // Run function auto logout every interval
                setInterval(function(){ auto_logout() }, timeout);
            });
        </script> 
    </body>
</html>